//
//  ZMMineViewController.swift
//  LoveBeen
//
//  Created by pg on 2017/8/6.
//  Copyright © 2017年 pg. All rights reserved.
//

import UIKit

class ZMMineViewController: ZMBaseController {

    
    
    override func viewDidLoad() {
        super.viewDidLoad()

//        if isLogin == false{
//            self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.plain, target: nil, action: nil)
//            self.navigationController?.pushViewController(ZMLoginViewController(), animated: true)
//            
//        }
        
    NotificationCenter.default.addObserver(self, selector: #selector(tabbarNoti(info:)), name: NSNotification.Name("tabbar"), object: nil)

        
     //   self.tabBarController?.selectedIndex = self.lastTabBarIndex
    }
    func tabbarNoti(info: Notification) -> Void {
        
        lastTabBarIndex = info.object as! Int
        
    }
    override func viewDidAppear(_ animated: Bool) {
      //  print(lastTabBarIndex)
        super.viewDidAppear(true)
     //   self.tabBarController?.selectedIndex = self.lastTabBarIndex
        
        self.tabBarController?.selectedViewController = self.tabBarController!.viewControllers![self.lastTabBarIndex]
        
    }
    
    
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
